package model.entity.building;

import java.util.LinkedList;
import java.util.List;

import model.entity.Entity;
import model.entity.unit.Unit;
import model.world.World;
import model.world.tile.ResourceType;
import model.world.tile.Tile;

public class Building extends Entity {
	List<Unit> presentUnits;

	public Building(World world, Tile parent, int entityID) {
		super(world, parent, entityID);
		presentUnits = new LinkedList<Unit>();
	}

	@Override
	public int getResourceCollectionRate(ResourceType t) {
		return 0;
	}

	@Override
	public void tick() {
		for(Unit u : presentUnits){
			u.tick();
		}
	}

	public boolean removePresentUnit(Unit unit) {
		return presentUnits.remove(unit);
	}
	
	public boolean addPresentUnit(Unit unit){
		return presentUnits.add(unit);
	}

}
